home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / TODO.PAK / TODODLGS.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  133 lines

  1. //---------------------------------------------------------------------
  2. //
  3. //  TODODLGS.H
  4. //
  5. //      Copyright (c) 1991, 1995 by Borland International
  6. //      All Rights Reserved.
  7. //
  8. //  Defines the following classes, which handle all the dialog boxes for
  9. //  the Todo program.
  10. //
  11. //      AboutBox
  12. //
  13. //      FileBox     - provides a an interface to the Windows common
  14. //                    dialogs for selecting a file name.
  15. //
  16. //      EditBox     - provides a dialog box for editing an entry in the
  17. //                    Todo list.
  18. //
  19. //---------------------------------------------------------------------
  20. #if !defined(TODODLGS_H)
  21. #define TODODLGS_H
  22.  
  23. #include <services/wsysinc.h>
  24. #include <commdlg.h>
  25. #include <dir.h>
  26. #include <strstrea.h>
  27.  
  28. #include "todowin.h"
  29. #include "todolist.h"
  30.  
  31. //---------------------------------------------------------------------
  32. //
  33. //  class AboutBox
  34. //
  35. //      draws and manages the About dialog.
  36. //
  37. //---------------------------------------------------------------------
  38.  
  39. class AboutBox : public ModalDialog
  40. {
  41.  
  42. public:
  43.  
  44.     AboutBox( HWND );
  45.  
  46. private:
  47.  
  48.     virtual LPSTR GetDialogName();
  49.  
  50.     virtual BOOL Dispatch( HWND, UINT, WPARAM, LPARAM );
  51.  
  52. };
  53.  
  54. //---------------------------------------------------------------------
  55. //
  56. //  class FileBox
  57. //
  58. //      draws and manages a dialog box for selecting a file.
  59. //
  60. //---------------------------------------------------------------------
  61.  
  62. class FileBox
  63. {
  64.  
  65. public:
  66.  
  67.     static BOOL GetOpenFileName( HWND handle, char *fileName, char *titleName );
  68.     static BOOL GetSaveFileName( HWND handle, char *fileName, char *titleName );
  69.  
  70. private:
  71.  
  72.     static OPENFILENAME ofn;
  73.     static char *filters[];
  74.  
  75. };
  76.  
  77. //---------------------------------------------------------------------
  78. //
  79. //  class EditBox
  80. //
  81. //      draws and manages a dialog box to edit an entry in the Todo list.
  82. //
  83. //---------------------------------------------------------------------
  84.  
  85. class TodoEntry;
  86.  
  87. class EditBox : public ModalDialog
  88. {
  89.  
  90. public:
  91.  
  92.     EditBox( HWND, TodoEntry& );// constructor for the EditBox.
  93.                                 //
  94.                                 // Arguments:
  95.                                 //
  96.                                 // HWND owner - handle of the owner
  97.                                 //              of this dialog
  98.                                 // TodoEntry& td - the entry to be edited
  99.  
  100. private:
  101.  
  102.     virtual LPSTR GetDialogName();
  103.  
  104.     virtual BOOL Dispatch( HWND, UINT, WPARAM, LPARAM );
  105.  
  106.     TodoEntry& Current;         // the entry being edited
  107.  
  108.     int Button;                 // current selection among the radio
  109.                                 // buttons that set the priority
  110.  
  111.     void InitDlg( HWND );       // used internally
  112.     void CheckButton( HWND, WPARAM );  // used internally
  113.     void OkCmd( HWND );         // used internally
  114.     void CancelCmd( HWND );     // used internally
  115. };
  116.  
  117. //---------------------------------------------------------------------
  118. //
  119. //  inline functions
  120. //
  121. //---------------------------------------------------------------------
  122.  
  123. inline AboutBox::AboutBox( HWND hOwner ) : ModalDialog( hOwner )
  124. {
  125. }
  126.  
  127. inline EditBox::EditBox( HWND hOwner, TodoEntry& td ) :
  128.     ModalDialog( hOwner ), Current( td )
  129. {
  130. }
  131.  
  132. #endif  // TODODLGS_H
  133.